package com.gblfy.wx.miniapp.controller;

import com.gblfy.wx.miniapp.vo.ResponseDto;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 热搜列表用于测试前后端数据交互
 *
 * @author gblfy
 * @date 2022-01-02
 */
@RestController
public class HotController {

    @GetMapping("/hot/tabs")
    public ResponseDto hotList() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", 1);
        map.put("label", "热榜");
        Map<String, Object> map2 = new HashMap<>();
        map2.put("id", 2);
        map2.put("label", "热榜2");
        Map<String, Object> map3 = new HashMap<>();
        map3.put("id", 3);
        map3.put("label", "热榜3");
        Map<String, Object> map4 = new HashMap<>();
        map4.put("id", 4);
        map4.put("label", "热榜4");
        Map<String, Object> map5 = new HashMap<>();
        map5.put("id", 5);
        map5.put("label", "热榜5");
        List<Map<String, Object>> list = new ArrayList<>();
        list.add(map);
        list.add(map2);
        list.add(map3);
        list.add(map4);
        list.add(map5);
        ResponseDto dto = new ResponseDto();
        dto.setContent(list);
        return dto;
    }
}
